
readParam <- function(inputFile,md,targetFile){

con  <- file(inputFile, open = "r")
con2  <- file(targetFile, open = "w")

while (length(oneLine <- readLines(con, n = 1, warn = FALSE)) > 0) {
             if(md==1 && oneLine=="Step1Jacobian") break;     
		 if(md==2 && oneLine=="Step1Gradients") break;    
                                               if(length(oneLine)<1) break;
                                               if(oneLine=="") break;
                                writeLines(oneLine,con2)
    }         
close(con)
close(con2)
}

 